{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "目标可视化工具专门用于直观地描述用于监督建模的因变量，通常称为y目标。当前实现了以下可视化：\n",
    "+ 平衡箱可视化Balanced Binning：生成带有垂直线的直方图，垂直线显示推荐值点，以将数据装箱到均匀分布的箱中。\n",
    "+ 类平衡Class Balance：可视化来检查目标，以显示每个类对最终估计器的支持。\n",
    "+ 特征相关Feature Correlation：绘制特征和因变量之间的相关性。\n",
    "\n",
    "头文件调用如下：\n",
    "```\n",
    "# Target Visualizers Imports\n",
    "from yellowbrick.target import BalancedBinningReference\n",
    "from yellowbrick.target import ClassBalance\n",
    "from yellowbrick.target import FeatureCorrelatio\n",
    "```\n",
    "\n",
    "本文如果数据集下载不下来，查看下面地址，然后放入yellowbrick安装目录\\datasets\\fixtures文件夹:\n",
    "```\n",
    "{\n",
    "  \"bikeshare\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/bikeshare.zip\",\n",
    "    \"signature\": \"4ed07a929ccbe0171309129e6adda1c4390190385dd6001ba9eecc795a21eef2\"\n",
    "  },\n",
    "  \"hobbies\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/hobbies.zip\",\n",
    "    \"signature\": \"6114e32f46baddf049a18fb05bad3efa98f4e6a0fe87066c94071541cb1e906f\"\n",
    "  },\n",
    "  \"concrete\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/concrete.zip\",\n",
    "    \"signature\": \"5807af2f04e14e407f61e66a4f3daf910361a99bb5052809096b47d3cccdfc0a\"\n",
    "  },\n",
    "  \"credit\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/credit.zip\",\n",
    "    \"signature\": \"2c6f5821c4039d70e901cc079d1404f6f49c3d6815871231c40348a69ae26573\"\n",
    "  },\n",
    "  \"energy\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/energy.zip\",\n",
    "    \"signature\": \"174eca3cd81e888fc416c006de77dbe5f89d643b20319902a0362e2f1972a34e\"\n",
    "  },\n",
    "  \"game\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/game.zip\",\n",
    "    \"signature\": \"ce799d1c55fcf1985a02def4d85672ac86c022f8f7afefbe42b20364fba47d7a\"\n",
    "  },\n",
    "  \"mushroom\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/mushroom.zip\",\n",
    "    \"signature\": \"f79fdbc33b012dabd06a8f3cb3007d244b6aab22d41358b9aeda74417c91f300\"\n",
    "  },\n",
    "  \"occupancy\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/occupancy.zip\",\n",
    "    \"signature\": \"0b390387584586a05f45c7da610fdaaf8922c5954834f323ae349137394e6253\"\n",
    "  },\n",
    "  \"spam\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/spam.zip\",\n",
    "    \"signature\": \"000309ac2b61090a3001de3e262a5f5319708bb42791c62d15a08a2f9f7cb30a\"\n",
    "  },\n",
    "  \"walking\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/walking.zip\",\n",
    "    \"signature\": \"7a36615978bc3bb74a2e9d5de216815621bd37f6a42c65d3fc28b242b4d6e040\"\n",
    "  },\n",
    "  \"nfl\": {\n",
    "    \"url\": \"https://s3.amazonaws.com/ddl-data-lake/yellowbrick/v1.0/nfl.zip\",\n",
    "    \"signature\": \"4989c66818ea18217ee0fe3a59932b963bd65869928c14075a5c50366cb81e1f\"\n",
    "  }\n",
    "}\n",
    "```\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# 1 平衡箱可视化Balanced Binning\n",
    "通常，现实世界中的机器学习问题会受到维数诅咒的影响；训练实例比预期的要少，而且预测信号分布在许多不同的特征上。有时，当目标变量连续赋值时，根本没有足够的实例来预测这些值达到回归的精度。在这种情况下，我们有时可以将问题转化为连续的分类问题。\n",
    "\n",
    "为了帮助用户选择最佳的仓位数量，BalancedBiningReference visualizer将目标变量y作为输入，并生成一个直方图，其中竖线表示建议的值点，以确保数据均匀地分布到每个仓位中。\n",
    "\n",
    "|可视化器|BalancedBinningReference|\n",
    "|-|-|\n",
    "|快速使用方法|balanced_binning_reference()|\n",
    "|模型|分类|\n",
    "|工作流程|特征分析，目标分析，模型选择|\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 多行输出\r\n",
    "from IPython.core.interactiveshell import InteractiveShell\r\n",
    "InteractiveShell.ast_node_interactivity = \"all\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 1.1 基本使用\n",
    "BalancedBinningReference实际就是应用numpy中的histogram进行数据可视化,histogram()会对区间中数组所对应的权值进行求和，bins决定分箱个数。关于numpy中的histogram函数具体见：\n",
    "[numpy之histogram](https://blog.csdn.net/yangwangnndd/article/details/89489946)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 800x550 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "from yellowbrick.datasets import load_concrete\n",
    "from yellowbrick.target import BalancedBinningReference\n",
    "import numpy as np\n",
    "# Load the concrete dataset\n",
    "X, y = load_concrete()\n",
    "\n",
    "# Instantiate the visualizer\n",
    "# 可视化器，求各个区间的平均值\n",
    "visualizer = BalancedBinningReference(bins=5)\n",
    "\n",
    "# Fit the data to the visualizer\n",
    "# 拟合数据\n",
    "a=visualizer.fit(y)\n",
    "# 显示数据     \n",
    "visualizer.show();       "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 1.2 快速方法\n",
    "上面的相同功能可以通过关联的快速方法来实现balanced_binning_reference。此方法将BalancedBinningReference使用关联的参数构建对象，将其拟合，然后（可选）立即显示它。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEJCAYAAABrHbdyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEiZJREFUeJzt3X+Q3HV9x/FnDHNHTKgQLAQjU6qtbydzM3R6TVFjNFoQUShTIzLTFLHQilQ7gjIdpioStLXF8UerTDUD8stxqqSdAoMFJ06nIggTtxo9tW+EUaomFio1DU7cA5L+8f3ezCa5vd079va7fPJ8zNyw+/l+v7svvrf72u99v9/9Zsn+/fuRJJXhWU0HkCQNjqUuSQWx1CWpIJa6JBXEUpekgljqklSQI3rNEBEbgFuA79RD3wauBm4GlgK7gPMysx0Rm4BLgH3Alsy8bjFCS5Jmt6TXeep1qb8jM9/YMXY98MXMvCUi/hr4EXAT8B/A7wLTwHbgFZn52GyP22q1xoG1VB8KTz39/xVJOiwsBU4Atk9OTrYPnthzS72LDcDb6tu3A5cBCWzPzN0AEXEPsK6ePpu1wN0LfH5JOtytB7568GC/pb4mIm4DVgKbgeWZOfMJ8QjVp8Yq4NGOZWbGu9kF8KIXvYixsbEDJkxNTTExMdFntOEx1/yYa37MNT+Ha67p6WkeeOABqDv0YP2U+vepivwLwAuAfztouSVdlus2PuMpYCbcIaampvqINnzmmh9zzY+55ucwzzXrbuuepZ6ZPwE+X999KCJ+CqyNiGWZuRdYDeysf1Z1LLoauK/X409MTDA+Pn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c4KTMfF+zqaT+uaUudcjMXwL/DPwB1cXlPtNsIml+LHXpUFuAPwOWzHEddmkkWerSQTLzu1T/yPINDUeR5s1Slw4SESdRXUf8nxqOIs2bpS51iIi/BG4F/rTJa79LC+XZL5JUELfUJakglrokFcRSl6SCWOqSVBBLXZIKYqlLUkH+HyZlwvaT4zTvAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from yellowbrick.datasets import load_concrete\r\n",
    "from yellowbrick.target import balanced_binning_reference\r\n",
    "\r\n",
    "# Load the dataset\r\n",
    "X, y = load_concrete()\r\n",
    "\r\n",
    "# Use the quick method and immediately show the figure\r\n",
    "balanced_binning_reference(y);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# 2 类平衡Class Balance\n",
    "分类模型面临的最大挑战之一是训练数据中类的不平衡。严重的类不平衡可能被相对较好的F1和准确度分数掩盖-分类器只是猜测大多数类，而不对代表性不足的类进行任何评估。\n",
    "\n",
    "有几种处理类不平衡的技术，例如分层抽样，对多数类进行下采样，加权等。但是，在采取这些措施之前，了解训练数据中的类平衡是什么很重要。ClassBalance visualizer通过为每个类创建支持的条形图来支持这一点，即数据集中类表示的频率。\n",
    "\n",
    "\n",
    "|可视化器|ClassBalance|\n",
    "|-|-|\n",
    "|快速使用方法|class_balance()|\n",
    "|模型|分类|\n",
    "|工作流程|特征分析，目标分析，模型选择|"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 2.1 基本使用\n",
    "结果图使我们能够诊断余额问题的严重性。 在此图中，我们可以看到“ win”类主导了其他两个类。 一种可能的解决方案是创建一个二进制分类器：“ win”与“ not win”，并将“ loss”和“ draw”类组合为一个类。ClassBalance函数的功能就是计算各个类下样本数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collaps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/ElEXAXsmpm7RMQdwBeAA4HpwH6T8XYCu6rG3j8CSzJzAfCzWrYp8N3MPA14DvDezNwHuJGyQ7kOeFVETKHcAT+3zjcPuGYsG6/GdgGOpHyDwQLgLRHxQuA9wImZuRfwdWCbYco0efQCs4GXAT8B9oiITYBXAr+rdaYCSzNzT+BuynfvTToGx9jbHfhhfX1tS/mP678PAh+NiOuAt1J2HtdRvkb+pcAtwOYR0QXMysxfj0WjNWovA27KzFWZuYpyMDAHuAj4fET8b+CW2p0xVJkmj4H/p/OAsyiB8VLgp4PqXV//vQ/Ycsxa9wwyOMZeF6ULCtb++w98HeWZwJn1qPMLAJm5DNiJ8oH8IfBr4ADAGx8nvn7W/j61acCazLyA0jX1CHBZROw2VNmYt1ZPx7WU4HgV8H1KKAzVK7Cq5fVI37U3YRkcYy+BV9TX+wwxfVvgzoiYDryOsqOBEhZ/B9xUfxZiN9VkcAuly2JqREylHIXeEhEnAyszcxGlW2r3ocrGrdVqrB7g7QhsWcctfkv5P7vB/T81OMbe+ZTxiquBoByRtjqL8ryRi+rrt0fEHMpp8A6Z+SglOPZj7a4uTUz3AIso2+964EuZeS/lQGBxRCymdF1dOUyZJpeHgHvr65uBnSldUhsUv3JEktSIZxySpEYMDklSIwaHJKkRg0OS1IjBIUlqxOCQJDVicEiSGvn/8/NX4dMWpO0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from yellowbrick.datasets import load_game\r\n",
    "from yellowbrick.target import ClassBalance\r\n",
    "\r\n",
    "# Load the classification dataset\r\n",
    "# 载入分类数据库\r\n",
    "X, y = load_game()\r\n",
    "# Instantiate the visualizer\r\n",
    "# ClassBalance函数的功能就是计算各个类下样本数。\r\n",
    "visualizer = ClassBalance(labels=[\"draw\", \"loss\", \"win\"])\r\n",
    "\r\n",
    "visualizer.fit(y)        # Fit the data to the visualizer\r\n",
    "visualizer.show();        # Finalize and render the figure"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "如果在评估期间必须保持类别不平衡(例如，被分类的事件实际上如频率所暗示的那样罕见)，则应使用分层抽样来创建训练和测试集。\r\n",
    "这确保了测试数据与训练数据具有大致相同的类比例。虽然SCRICIT-LEARN默认在Train_Test_Split和其他cv方法中执行此操作，但是比较两个Split中每个类的支持情况可能是有用的。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "ClassBalance可视化工具具有“比较”模式，在该模式下，可以将训练和测试数据传递给FIT()，从而创建并排条形图而不是单个条形图，如下所示："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/sklearn/model_selection/_split.py:752: FutureWarning: You should specify a value for 'n_splits' instead of relying on the default value. The default value will change from 3 to 5 in version 0.22.\n",
      "  warnings.warn(NSPLIT_WARNING, FutureWarning)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEHCAYAAAC5u6FsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3X+cVVW9//HXMDAToKJgBuJvgg96R706qVeBlITIQkuRMgwD7VGZGlj3mqYYWHy10rJATUxFLcTELMEUxTTFjLhzTR3RDyD+IlBRfogwnmF+fP9Ya/QwnJk5e5xzzgzzfj4e8+Ccddbe+7PP2ezPXmvtH0X19fWIiIhkq0uhAxARkY5FiUNERBJR4hARkUSUOEREJBElDhERSUSJQ0REElHiEBGRRLoWOgBpH8ysCLgQOBvoRtg2FgKXuPsmM5sNrH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fb/mA18DMpW9C/Qzs1WEB2c9Hed7rJkVA3sAuwLvpC1zCfAl4AYz+wzhvmIPAgebWQnwMUJLSKQ5jbfdGjJvo9puC0AZtGN6hNCsfgwYzI5HYg3mEv5jPRpffyuWfweYB/wdeMTdNzZRNpPwn/GPwPNp830FuBv4K3Cpu6cvfyrwJTN7HPgR8JS7rwduA54iDEDqiY3SkkzbrrbbdkK3HJFE0s/oKnQsItnSdtu21OIQEZFE1OIQEZFE1OIQEZFElDhERCQRJQ4REUlEiUNERBJR4hARkUT+PyV1RwIa9k93AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.model_selection import TimeSeriesSplit\r\n",
    "\r\n",
    "from yellowbrick.datasets import load_occupancy\r\n",
    "from yellowbrick.target import ClassBalance\r\n",
    "\r\n",
    "# Load the classification dataset\r\n",
    "X, y = load_occupancy()\r\n",
    "\r\n",
    "# Create the training and test data\r\n",
    "# 时间分割序列数据\r\n",
    "tscv = TimeSeriesSplit()\r\n",
    "for train_index, test_index in tscv.split(X):\r\n",
    "    X_train, X_test = X.iloc[train_index], X.iloc[test_index]\r\n",
    "    y_train, y_test = y.iloc[train_index], y.iloc[test_index]\r\n",
    "\r\n",
    "# Instantiate the visualizer\r\n",
    "visualizer = ClassBalance(labels=[\"unoccupied\", \"occupied\"])\r\n",
    "\r\n",
    "visualizer.fit(y_train, y_test)        # Fit the data to the visualizer\r\n",
    "visualizer.show();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "这种可视化使我们可以快速检查，以确保每个类在两个拆分中的比例大致相似。这种可视化应该是第一步，尤其是当评估指标在不同的分割中高度可变时。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 2.2 快速使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    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J/M/ElEXAXsmpm7RMQdwBeAA4HpwH6T8XYCu6rG3j8CSzJzAfCzWrYp8N3MPA14DvDezNwHuJGyQ7kOeFVETKHcAT+3zjcPuGYsG6/GdgGOpHyDwQLgLRHxQuA9wImZuRfwdWCbYco0efQCs4GXAT8B9oiITYBXAr+rdaYCSzNzT+BuynfvTToGx9jbHfhhfX1tS/mP678PAh+NiOuAt1J2HtdRvkb+pcAtwOYR0QXMysxfj0WjNWovA27KzFWZuYpyMDAHuAj4fET8b+CW2p0xVJkmj4H/p/OAsyiB8VLgp4PqXV//vQ/Ycsxa9wwyOMZeF6ULCtb++w98HeWZwJn1qPMLAJm5DNiJ8oH8IfBr4ADAGx8nvn7W/j61acCazLyA0jX1CHBZROw2VNmYt1ZPx7WU4HgV8H1KKAzVK7Cq5fVI37U3YRkcYy+BV9TX+wwxfVvgzoiYDryOsqOBEhZ/B9xUfxZiN9VkcAuly2JqREylHIXeEhEnAyszcxGlW2r3ocrGrdVqrB7g7QhsWcctfkv5P7vB/T81OMbe+ZTxiquBoByRtjqL8ryRi+rrt0fEHMpp8A6Z+SglOPZj7a4uTUz3AIso2+964EuZeS/lQGBxRCymdF1dOUyZJpeHgHvr65uBnSldUhsUv3JEktSIZxySpEYMDklSIwaHJKkRg0OS1IjBIUlqxOCQJDVicEiSGvn/8/NX4dMWpO0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from yellowbrick.datasets import load_game\r\n",
    "from yellowbrick.target import class_balance\r\n",
    "\r\n",
    "# Load the dataset\r\n",
    "X, y = load_game()\r\n",
    "\r\n",
    "# Use the quick method and immediately show the figure\r\n",
    "class_balance(y);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# 3 特征相关Feature Correlation\n",
    "该可视化工具计算皮尔逊相关系数和特征与因变量之间的互信息。\n",
    "这种可视化可以用于特征选择，以识别与因变量具有高相关性或大互信息的特征。\n",
    "\n",
    "默认计算是Pearson相关性，这是使用scipy.stats.Pearsonr执行的。\n",
    "\n",
    "|可视化器|FeatureCorrelation|\n",
    "|-|-|\n",
    "|快速使用方法|feature_correlation()|\n",
    "|模型|回归/分类/聚类|\n",
    "|工作流程|特征分析/模型选择|"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 3.1 Person分析\n",
    "FeatureCorrelation通过method设置来确定分析方法，默认是person分析，除此之外还有mutual_info-regression，通过sklearn.feature_selection中的mutual_info-regression计算，还有mutual_info-classification，通过sklearn.feature_selection中的mutual_info_classif计算。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEVCAYAAADwyx6sAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAHQNJREFUeJzt3XmcXFWd9/FPSEjYRCCEVTCyfTUGUcNigIQdGVaBAE6AEIQREEG2B0UWeRSBUSK4PDOOIgPCgEgQhk0ISQDDAEYSM49h+SEwKJtAZEfMRuaPczpcik53dfWt6u7b3/frlVeq7nLu71RV/+rUufeeM2DJkiWYmVnft1xPB2BmZuVwQjczqwgndDOzinBCNzOrCCd0M7OKcEI3M6sIJ/QSSFoi6XFJjxb+3dGN8oZImlBmjL2RpKckbd/JNktfC0nrS5rbmujee7za9yS/5x9qoMxFkoaXGGaXSZoqaWI39peksSWGVCy7rvdY0t2SDmtn+XBJi5oRW18wqKcDqJAdI+KZksr6FDAB+HlJ5fVlS1+LiHgWGNmqA9ccz+/Ju/Yn5Y7flF1wq9/jqnFCb7LcivtXQHnRVyLi13nd0cCppPfheeB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PyMYeRxqsH+BjwfyPi/Pz8k8CeeUCl84Dbc33GAt+UNKzm2CsCu0fEDqQBmQ7Ld0rOAU6NiOmF17GjOEaQ7qgcm/c9BOt33EK3Zhkm6e78eDlSMr84jxwo4GeS2rZdNY8F/RfgIkkrkFq0rxTKuw9SkpV0B3CPpBuAayPiGUmnAFNzC3uxpBnAVsCDwCMR8WIu50/AGjWxLgYGdlCXbUjDTLSNZnl3Lvse0jjtxfE2ZkfE/Px4J2ArSUfk5wtJXzpFfwVuk/QOaQjk51m2juKYFxEPdVBH6wec0K1Z3tOH3kbSfNI0ge2tuxI4JiKmS9qb9/a3Lx1pMiLGSfooaaTNeyQdSOpmKRpQWLaonXVFc4FPSRpSSMZI2oyUcDsqe0HNuuLz+aRuowdr6rln/v9DwEXAxyPiRUmdjU/TnTpaP+AuF2upiHgNeKqQ1DaTdE5evTbwUO6iOYg0dOp7SNpI0skR8WhETCJ1uWxBmtxjN0kD8oiMO1DnhB95NMdpwPfysduS7Q3AJ3I5O+VhjCHNOlNP2feSuoKQtKKkf8mxtVmL1LJ+MY8Bvnuhzu+Qzi8UNRqH9RNO6NYTJgBnSPoNcAVwZ17+z8B00onGy4ENJNVe4fEMqTU9M48X/RHgeuA64HFSEr0XuDEi/qsLMX0BeBP4/zmuq0h92HdFxG+BXwAzJP0X8DRpIt/OnAtsKule0knh39f0088B/ihpJvD/gG8AR+aTw3cC/ybpgLaNuxGH9RMebdHMrCLcQjczqwgndDOzinBCNzOrCCd0M7OKcEI3M6sIJ3Qzs4pwQjczq4j/BRqSfFJzZ3RuAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn import datasets\r\n",
    "from yellowbrick.target import FeatureCorrelation\r\n",
    "\r\n",
    "# Load the regression dataset\r\n",
    "data = datasets.load_diabetes()\r\n",
    "X, y = data['data'], data['target']\r\n",
    "\r\n",
    "# Create a list of the feature names\r\n",
    "features = np.array(data['feature_names'])\r\n",
    "\r\n",
    "# Instantiate the visualizer\r\n",
    "# 计算x中的每个特征与y的相关性\r\n",
    "visualizer = FeatureCorrelation(labels=features)\r\n",
    "\r\n",
    "# Fit the data to the visualizer\r\n",
    "visualizer.fit(X, y)        \r\n",
    "visualizer.show();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 3.2 Mutual Information Regression分析\n",
    "互信息详细见：[https://www.cntofu.com/book/48/shu-xue-ji-chu/xin-xi-lun/hu-xin-xi.md](https://www.cntofu.com/book/48/shu-xue-ji-chu/xin-xi-lun/hu-xin-xi.md)\n",
    "\n",
    "互信息与相关性的区别见：[https://blog.csdn.net/gdanskamir/article/details/54913233](https://blog.csdn.net/gdanskamir/article/details/54913233)\n",
    "\n",
    "但是回归中，连续数据需要转换为离散数据。特征和因变量之间的相互信息是使用sklearn.feature_selection.mutual_info_classifwhen method='mutual_info-classification'和mutual_info_regressionwhen 计算的method='mutual_info-regression'。在计算互信息时，指定离散特征非常重要，因为连续变量和离散变量的计算是不同的。sklearn中参考文档见[http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.mutual_info_classif.html](http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.mutual_info_classif.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEVCAYAAADwyx6sAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAHLJJREFUeJzt3Xm0XFWZ9/FvICRAkCnMiB0B+SnGl24vYjMkhIioTBEI6GKIIDSCMim0qAzSMrYYh9Z+nYCOBEEkDCaAgAzB8AIiF+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RuZlYRTuhmZhXhhG5mVhFO6GZmFfH/ASl+aYHjnXImAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn import datasets\r\n",
    "from yellowbrick.target import FeatureCorrelation\r\n",
    "import numpy as np\r\n",
    "\r\n",
    "# Load the regression dataset\r\n",
    "data = datasets.load_diabetes()\r\n",
    "X, y = data['data'], data['target']\r\n",
    "\r\n",
    "# Create a list of the feature names\r\n",
    "features = np.array(data['feature_names'])\r\n",
    "\r\n",
    "# Create a list of the discrete features\r\n",
    "# 创建离散变量列表\r\n",
    "discrete = [False for _ in range(len(features))]\r\n",
    "# discrete为age需要变为离散变量\r\n",
    "discrete[1] = True\r\n",
    "\r\n",
    "# Instantiate the visualizer\r\n",
    "visualizer = FeatureCorrelation(method='mutual_info-regression', labels=features)\r\n",
    "\r\n",
    "visualizer.fit(X, y, discrete_features=discrete, random_state=0)\r\n",
    "visualizer.show();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 3.3 Mutual Information Classification分析\n",
    "通过与pandas DataFrame配合，可以从列名称中自动获取功能标签。该可视化器还允许根据计算出互信息（或Pearson相关系数）对条形图进行排序，并通过指定特征名称或特征索引来选择要绘制的特征。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ8AAAEVCAYAAAA/yegqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAHKZJREFUeJzt3XmYXGWZ9/FvCCSI7MQFVIyA3C44jjYqWyBBhxEQfAOo4wKi4IKAojIyigu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9GxNKyDTLz/nLJ9VcjYgnwF5qeozQov9VaklSdh90kSdUZPpKk6gwfSVJ1ho8kqTrDR5JUneEjSarO8JEkVff/AeahoM0tHmdhAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\r\n",
    "\r\n",
    "from sklearn import datasets\r\n",
    "from yellowbrick.target import FeatureCorrelation\r\n",
    "\r\n",
    "# Load the regression dataset\r\n",
    "# 导入分类数据\r\n",
    "data = datasets.load_wine()\r\n",
    "X, y = data['data'], data['target']\r\n",
    "X_pd = pd.DataFrame(X, columns=data['feature_names'])\r\n",
    "\r\n",
    "# Create a list of the features to plot\r\n",
    "features = ['alcohol', 'ash', 'hue', 'proline', 'total_phenols']\r\n",
    "\r\n",
    "# Instaniate the visualizer\r\n",
    "# sort设置是否排序\r\n",
    "visualizer = FeatureCorrelation(\r\n",
    "    method='mutual_info-classification', feature_names=features, sort=True\r\n",
    ")\r\n",
    "\r\n",
    "visualizer.fit(X_pd, y)        # Fit the data to the visualizer\r\n",
    "visualizer.show();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 3.4 快速使用\n",
    "上面的相同功能可以通过关联的快速方法来实现feature_correlation。此方法将FeatureCorrelation使用关联的参数构建对象，将其拟合，然后（可选）立即显示它"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbIAAAEVCAYAAACFamBKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xe4XFW5x/FvSEikCwm9GEH4SQg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W4M4riN9+Xs70k/V7B0RPX3pMOshPkZm1sny1UwOJF0/EOBXwOg8YjuORdejHEC6KsRI0kVoT600s1wu/zrpKg1DI2IY8DtgdeBQ4P2kn8UZTvrNpp1z3aHAqfm3qeYDH6oJcRDwUL7c0psqSWwo6beghuU+VyX9rhyk6/Z9MyLOzPe3APbKF839DnBz3p/hwLckrVrT9zLAHhGxM+nSSYfnq3s8BJwcEeMrj2OjOAaRrgIyPNc9DHvX8ojMrHOsKmlCXl6KlMTOzVehF/BzSS1lV8y/a/V34BxJ7yGNYF6qtHc3pOQi6Q/AREnXAL+JiBmSTgJuyyOq+flCsNsADwCPRMQLuZ2ngFVqYp0P9G6wL9uRLnfW8isEE3LbE0m/E1W9tuCDETE7L48AtpH08Xx/LinZVr0I/F7SAtLliWbSukZxzIqIvzTYR3sXcSIz6xxvOUbWQtJsYHYr264Ajo2I8ZL24a3H0978hYCIOFjSB0m/bDBR0kGk6cSqXpV18+psq5oGbCmpXyUJIWkjUqJp1Pacmm3V+7NJ06MP1OznXvl2HeAcYJOIeEFSW9esXJx9tHcRTy2adaGIeBmYXnkz30jS6Xnz6sBf8lTkIaSfMXkLSetLOjEiHo2IMaSpxc1JPz66u6Re+QrhO9PkD5Lmq4vfDvx37rslyVwDbJbbGZF/dgfSr/M20/Zk0pQnkpaR9KMcW4vVSCOpF/LvkO1R2ecFpOOHVR2Nw95lnMjMut6RwCmS7gQuB27N688GxpNOoLgMWFdS7Rl7M0ijpyn5t6/eD1wNXAU8Tkoek4FrI+KudsT0CeBV4E85rl+SjlHdERH3Ab8GJkm6C3gGuLKJNs8ANpQ0mXSyy//VHId7CPirpCnAD4FvAEfnk15uBf5H0oEthRcjDnuX8dXvzcysaB6RmZlZ0ZzIzMysaE5kZmZWNCcyMzMrmhOZmZkVzYnMzMyK5kRmZmZF+3+s4ls7JSMmuQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 432x288 with 0 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\r\n",
    "from sklearn import datasets\r\n",
    "import matplotlib.pyplot as plt\r\n",
    "from yellowbrick.target.feature_correlation import feature_correlation\r\n",
    "\r\n",
    "#Load the diabetes dataset\r\n",
    "data = datasets.load_iris()\r\n",
    "X, y = data['data'], data['target']\r\n",
    "\r\n",
    "features = np.array(data['feature_names'])\r\n",
    "visualizer = feature_correlation(X, y, labels=features)\r\n",
    "plt.tight_layout();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# 4 参考\n",
    "[https://www.scikit-yb.org/en/latest/api/target/binning.html](https://www.scikit-yb.org/en/latest/api/target/binning.html)\n",
    "\n",
    "[https://www.scikit-yb.org/en/latest/api/target/class_balance.html](https://www.scikit-yb.org/en/latest/api/target/class_balance.html)\n",
    "\n",
    "[https://blog.csdn.net/gdanskamir/article/details/54913233](https://blog.csdn.net/gdanskamir/article/details/54913233)\n",
    "\n",
    "[https://www.scikit-yb.org/en/latest/api/target/feature_correlation.html#yellowbrick.target.feature_correlation.FeatureCorrelation](https://www.scikit-yb.org/en/latest/api/target/feature_correlation.html#yellowbrick.target.feature_correlation.FeatureCorrelation)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "PaddlePaddle 1.8.0 (Python 3.5)",
   "language": "python",
   "name": "py35-paddle1.2.0"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
